package org.jeecg.modules.charge.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.charge.entity.ChargeInvoiceType;
import org.jeecg.modules.charge.mapper.ChargeInvoiceTypeMapper;
import org.jeecg.modules.charge.service.IChargeInvoiceTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;
import java.util.Map;

/**
 * @Description: 票据类型
 * @Author: jeecg-boot
 * @Date:   2019-07-07
 * @Version: V1.0
 */
@Service
public class ChargeInvoiceTypeServiceImpl extends ServiceImpl<ChargeInvoiceTypeMapper, ChargeInvoiceType> implements IChargeInvoiceTypeService {
    @Autowired
    private ChargeInvoiceTypeMapper chargeInvoiceTypeMapper;
    @Override
    public String getNameByCode(String typeCode) {
        String typeName=chargeInvoiceTypeMapper.getNameByCode(typeCode);
        return typeName;
    }

    @Override
    public ChargeInvoiceType selectByTypenum(String typeNum) {
        return chargeInvoiceTypeMapper.selectByTypenum(typeNum);
    }

    @Override
    public ChargeInvoiceType sureMoney(String typeNum) {
        return chargeInvoiceTypeMapper.sureMoney(typeNum);
    }

    @Override
    public Page<ChargeInvoiceType> listByParams(Page<ChargeInvoiceType> page, Map map) {
        return page.setRecords(chargeInvoiceTypeMapper.listByParams(page,map));
    }

    public List<ChargeInvoiceType> getInvoiceType(){
        return  chargeInvoiceTypeMapper.getInvoiceType();
    }
}
